/**********************************************************************/
/**  Copyright (c) ECC labs. 2001-2002. All Rights Reserved.		 **/
/**********************************************************************/
/*
	bincode.cpp
	Mark Papazyan

*/
#ifndef __CBINCODE_H
#define __CBINCODE_H


#include "binspace.h"



class CBinCode: public CBinSpace{
public:

//Variables

	t_len d;
	t_len* A;		//spector

//Constructor/Destructor

	CBinCode(t_len k=MAX_LENGTH, t_len n=MAX_HEIGHT, int flag=IS_G^ROW, int base=BIN);
	CBinCode(const CBinCode&);	//copy constructor
	~CBinCode();
	CBinCode(const CBinMatrix&);

//Manipulation

	void h1_to_h();	//makes H from H1, by adding identity matrix
	void g1_to_g();	//makes G from G1T, by adding identity matrix
	void h_to_h1();	//cuts H1 from H
	void g_to_g1();	//cuts G1T from G
	void spec();	//counts spectr, shows d, shows all combinations
	t_len get_d();
	t_len d1();	//counts d
	t_len d2(); //counts d
	void Mac_Wil();

//Operations

	CBinCode& operator=(const CBinCode&);	//assignment
	CBinCode& operator=(CBinMatrix&t);

};

//Input/Output

ostream& operator<<(ostream&, CBinCode&);
istream& operator>>(istream&, CBinCode&);
void c_init();
void showtab(t_tab*, t_len);
float c_n_k(t_len, t_len);
I c_n_k_2(t_len, t_len);

#endif
